<template>
  <footer class="footer">
    <div class="footer-container">
      <div class="footer-content">
        <div class="footer-section">
          <h3>联系我们</h3>
          <div class="footer-links">
            <a
                v-for="(item, index) in contactList" :key="index"
                :href=item.dicValue>
              {{ item.dicName }}
            </a>
          </div>
        </div>
        <div class="footer-section">
          <h3>友情链接</h3>
          <div class="friend-links">
            <a
                v-for="(item, index) in friendshipLinkList" :key="index"
                :href=item.dicValue>
              {{ item.dicName }}
            </a>
          </div>
        </div>
      </div>
      <div class="footer-bottom">
        <p v-for="(item, index) in copyrightList" :key="index">
          {{ item.dicName }}
        </p>
      </div>
    </div>
  </footer>
</template>

<script setup>
// 定义props
const props = defineProps({
  contactList: {
    type: Array,
  },
  friendshipLinkList: {
    type: Array,
  },
  copyrightList: {
    type: Array,
  },
})

</script>

<style scoped>
.footer {
  background-color: #4a4a4a;
  padding: 40px 0;
  margin-top: 40px;
  color: #fff;
}

.footer-container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

.footer-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 40px;
}

.footer-section {
  display: flex;
  flex-direction: column;
}

.footer-section h3 {
  color: #fff;
  margin-bottom: 20px;
  font-size: 16px;
  font-weight: normal;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.footer-links a {
  color: #999;
  text-decoration: none;
  font-size: 14px;
  line-height: 24px;
}

.friend-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.friend-links a {
  color: #999;
  text-decoration: none;
  font-size: 14px;
  line-height: 24px;
  transition: color 0.3s;
}

.friend-links a:hover {
  color: #fff;
}

.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid #666;
  text-align: center;
  color: #999;
  font-size: 12px;
}

@media (max-width: 768px) {
  .footer-content {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .footer-links {
    grid-template-columns: repeat(2, 1fr);
  }

  .friend-links {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
  }
}
</style>
